

#include "CoupledPorepressureADBC.h"
#include "libmesh/meshfree_interpolation.h"
#include "libmesh/system.h"
#include "libmesh/radial_basis_interpolation.h"
registerMooseObject("TrilobitaApp", CoupledPorepressureADBC);
InputParameters
CoupledPorepressureADBC::validParams()
{
	InputParameters params = ADIntegratedBC::validParams();
	params.addParam<Real>("L", 1e-4, "distance from the model");
	return params;
}

CoupledPorepressureADBC::CoupledPorepressureADBC(const InputParameters& parameters) :
	ADIntegratedBC(parameters),
	_rhog(getADMaterialProperty<Real>("pyrolysis_gas_density")),
	_permeability(getADMaterialProperty<Real>("permeability")),
	_viscosity(getADMaterialProperty<Real>("pyrolysis_gas_viscosity")),
	_Pe(getMaterialProperty<Real>("boundary_layer_edge_pressure"))

{
	_L = getParam<Real>("L");
}


ADReal
CoupledPorepressureADBC::computeQpResidual()
{
	ADReal massflux = _rhog[_qp] * _permeability[_qp] * (_u[_qp] - _Pe[_qp]) / (_viscosity[_qp] * _L);
	return _test[_i][_qp] * massflux;
}





